﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Communication.Lib.Mode
{
    public class KafkaBaseInfo : BaseInfo
    {
        public TopicName TopicName { get; set; }

        public string Data { get; set; }

        public JObject JObject { get; private set; }

        public virtual void Handle()
        {
            JObject = JsonConvert.DeserializeObject<JObject>(Data);
        }
    }

    public enum TopicName
    {
        DeviceData,
        DeviceStatus,
    }
}